package com.ssm.context;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;

/**
 * Created by Administrator on 2016/7/4.
 */
public class SpringApplicationContextHolder implements ApplicationContextAware{


    private static ApplicationContext applicationContext;

    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        SpringApplicationContextHolder.applicationContext = applicationContext;
    }


    public static ApplicationContext getContext(){
        return applicationContext;
    }
}
